.org 0x0
.global _start

_start:
	j mystart

.org 0x40
	

	lui x3,0x0
	
_loop1:
	addi x3,x3,0x1
	li x1,0x10000003
	sb x3,0x0(x1)
	
_loop2:
	li x1,0x10000001
	lw x2,0x0(x1)
	
	srl x2,x2,16
	andi x2,x2,0x1
	
	
	beq x2,x0,_loop2
	
	
	j _loop1
	
	mret
	
.org 0x200
mystart:

	li x1,0x10000003
	li x2,0x00001000
	sh x2,0x0(x1)
	
	li x1,0x10000000
	li x2,0x040000d9
	sw x2,0x0(x1)
	
	li x3,0x40000040
	csrrw x4,mtvec,x3
	
	
	ecall

_loop3:
	
	

	wfi
	j _loop3
	wfi
